
package com.plian.system.wrapper.bpa;

import com.plian.system.dto.bpa.BusinessAssessmentDTO;
import com.plian.system.entity.bpa.BusinessAssessment;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.bpa.BusinessAssessmentVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * @author BladeX
 * @since 2021-05-07
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface BusinessAssessmentWrapper extends BaseWrapper<BusinessAssessment, BusinessAssessmentDTO, BusinessAssessmentVO> {

    @Override
    @Mappings(value = {
            @Mapping(source = "dictIndicatorsCode", target = "dictIndicatorsName", qualifiedByName = DICT_CODE_TO_NAME),
            @Mapping(source = "dwType", target = "dwTypeName", qualifiedByName = DICT_CODE_TO_NAME),
            @Mapping(source = "dwUnit", target = "dwUnitName", qualifiedByName = DICT_CODE_TO_NAME),
            @Mapping(source = "scoreStandardUnit", target = "scoreStandardUnitName", qualifiedByName = DICT_CODE_TO_NAME),
            @Mapping(source = "enabled", target = "enabledName", qualifiedByName = IS_OR_NO)
    })
    BusinessAssessmentVO entityToVO(BusinessAssessment entity);
}
